<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg">
  <head>
    <title>Uniform vectors</title>
    <link rel="stylesheet" type="text/css" href="docbook-epub.css"/>
    <link rel="stylesheet" type="text/css" href="kawa.css"/>
    <script src="kawa-ebook.js" type="text/javascript"/>
    <meta name="generator" content="DocBook XSL-NS Stylesheets V1.79.1"/>
    <link rel="prev" href="Vectors.xhtml" title="Vectors"/>
    <link rel="next" href="Bytevectors.xhtml" title="Bytevectors"/>
  </head>
  <body>
    <header/>
    <section class="sect1" title="Uniform vectors" epub:type="subchapter" id="Uniform-vectors">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both">Uniform vectors</h2>
          </div>
        </div>
      </div>
      <p>Uniform vectors are vectors whose elements are of the same numeric type.
The are defined by <a class="ulink" href="http://srfi.schemers.org/srfi-4/srfi-4.html" target="_top">SRFI-4</a>.
The type names (such as <code class="literal">s8vector</code>) are a Kawa extension.
</p>
      <div class="literallayout">
        <p><a id="idm139667874374880" class="indexterm"/><span id="meta-uniform-vector"/><em class="replaceable"><code>uniform-vector</code></em> <code class="literal">::=</code> <code class="literal"><span class="bold"><strong>#</strong></span></code> <a class="link" href="Uniform-vectors.xhtml#meta-uniform-tag"><em class="replaceable"><code>uniform-tag</code></em></a> <a class="link" href="Datum-syntax.xhtml#meta-list"><em class="replaceable"><code>list</code></em></a><br/>
<a id="idm139667874370480" class="indexterm"/><span id="meta-uniform-tag"/><em class="replaceable"><code>uniform-tag</code></em> <code class="literal">::=</code> <code class="literal"><span class="bold"><strong>f32</strong></span></code> | <code class="literal"><span class="bold"><strong>f64</strong></span></code><br/>
    | <code class="literal"><span class="bold"><strong>s8</strong></span></code> | <code class="literal"><span class="bold"><strong>s16</strong></span></code> | <code class="literal"><span class="bold"><strong>s32</strong></span></code> | <code class="literal"><span class="bold"><strong>s64</strong></span></code><br/>
    | <code class="literal"><span class="bold"><strong>u8</strong></span></code> | <code class="literal"><span class="bold"><strong>u16</strong></span></code> | <code class="literal"><span class="bold"><strong>u32</strong></span></code> | <code class="literal"><span class="bold"><strong>u64</strong></span></code><br/>
</p>
      </div>
      <p>This example is a literal for a 5-element vector of unsigned short (<code class="literal">ushort</code>) values:
</p>
      <pre class="screen">(define uvec1 #u16(64000 3200 160 8 0))
</pre>
      <p>Since a uniform vector is a sequence, you can use function-call
notation to index one.  For example:
</p>
      <pre class="screen">(uvec1 1) ⇒ 3200
</pre>
      <p>In this case the result is a primitive unsigned short (<code class="literal">ushort</code>),
which is converted to a <code class="literal">gnu.math.UShort</code> if an object is needed.
</p>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874356816" class="indexterm"/> <code class="function">s8vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a signed 8-bit integer.  Represented using an array of <code class="literal">byte</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874353344" class="indexterm"/> <code class="function">u8vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
an unsigned 8-bit integer.  Represented using an array of <code class="literal">&lt;byte&gt;</code>,
but each element is treated as if unsigned.
</p>
          <p>This type is a synonym for <code class="literal">bytevector</code>,
which has <a class="link" href="Bytevectors.xhtml" title="Bytevectors">extra functions</a>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874348240" class="indexterm"/> <code class="function">s16vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a signed 16-bit integer.  Represented using an array of <code class="literal">short</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874344768" class="indexterm"/> <code class="function">u16vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
an unsigned 16-bit integer.  Represented using an array of <code class="literal">short</code>,
but each element is treated as if unsigned.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874341232" class="indexterm"/> <code class="function">s32vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a signed 32-bit integer.  Represented using an array of <code class="literal">int</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874337792" class="indexterm"/> <code class="function">u32vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
an unsigned 32-bit integer.  Represented using an array of <code class="literal">int</code>,
but each element is treated as if unsigned.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874334288" class="indexterm"/> <code class="function">s64vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a signed 64-bit integer.  Represented using an array of <code class="literal">long</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874330816" class="indexterm"/> <code class="function">u64vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
an unsigned 64-bit integer.  Represented using an array of <code class="literal">long</code>,
but each element is treated as if unsigned.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874327280" class="indexterm"/> <code class="function">f32vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a 32-bit floating-point real.  Represented using an array of <code class="literal">float</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Type"><span class="kind">Type</span><span class="ignore">: </span><a id="idm139667874323792" class="indexterm"/> <code class="function">f64vector</code></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>The type of uniform vectors where each element can contain
a 64-bit floating-point real.  Represented using an array of <code class="literal">double</code>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874320304" class="indexterm"/> <code class="function">s8vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874317472" class="indexterm"/> <code class="function">u8vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874314640" class="indexterm"/> <code class="function">s16vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874311808" class="indexterm"/> <code class="function">u16vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874308976" class="indexterm"/> <code class="function">s32vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874306144" class="indexterm"/> <code class="function">u32vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874303312" class="indexterm"/> <code class="function">s64vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874300480" class="indexterm"/> <code class="function">u64vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874297648" class="indexterm"/> <code class="function">f32vector?</code> <em class="replaceable"><code>value</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874294816" class="indexterm"/> <code class="function">f64vector?</code> <em class="replaceable"><code>value</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Return true iff <em class="replaceable"><code>value</code></em> is a uniform vector of the specified type.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874290960" class="indexterm"/> <code class="function">make-s8vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874287616" class="indexterm"/> <code class="function">make-u8vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874284272" class="indexterm"/> <code class="function">make-s16vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874280928" class="indexterm"/> <code class="function">make-u16vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874277584" class="indexterm"/> <code class="function">make-s32vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874274240" class="indexterm"/> <code class="function">make-u32vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874270896" class="indexterm"/> <code class="function">make-s64vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874267552" class="indexterm"/> <code class="function">make-u64vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874264208" class="indexterm"/> <code class="function">make-f32vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874260864" class="indexterm"/> <code class="function">make-f64vector</code> <em class="replaceable"><code>n</code></em> [<em class="replaceable"><code>value</code></em>]</p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Create a new uniform vector of the specified type,
having room for <em class="replaceable"><code>n</code></em> elements.
Initialize each element to <em class="replaceable"><code>value</code></em> if it is specified; zero otherwise.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874256032" class="indexterm"/> <code class="function">s8vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874252816" class="indexterm"/> <code class="function">u8vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874249600" class="indexterm"/> <code class="function">s16vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>..</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874246336" class="indexterm"/> <code class="function">u16vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874243120" class="indexterm"/> <code class="function">s32vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874239904" class="indexterm"/> <code class="function">u32vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874236688" class="indexterm"/> <code class="function">s64vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874233472" class="indexterm"/> <code class="function">u64vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874230256" class="indexterm"/> <code class="function">f32vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <p class="synopsis" kind="Constructor"><span class="kind">Constructor</span><span class="ignore">: </span><a id="idm139667874227040" class="indexterm"/> <code class="function">f64vector</code> <em class="replaceable"><code>value</code></em> <em class="replaceable"><code>...</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Create a new uniform vector of the specified type,
whose length is the number of <em class="replaceable"><code>value</code></em>s specified,
and initialize it using those <em class="replaceable"><code>value</code></em>s.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874222320" class="indexterm"/> <code class="function">s8vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874219520" class="indexterm"/> <code class="function">u8vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874216720" class="indexterm"/> <code class="function">s16vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874213920" class="indexterm"/> <code class="function">u16vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874211120" class="indexterm"/> <code class="function">s32vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874208320" class="indexterm"/> <code class="function">u32vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874205520" class="indexterm"/> <code class="function">s64vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874202720" class="indexterm"/> <code class="function">u64vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874199920" class="indexterm"/> <code class="function">f32vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874197120" class="indexterm"/> <code class="function">f64vector-length</code> <em class="replaceable"><code>v</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Return the length (in number of elements) of the uniform vector <em class="replaceable"><code>v</code></em>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874193344" class="indexterm"/> <code class="function">s8vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874190160" class="indexterm"/> <code class="function">u8vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874186976" class="indexterm"/> <code class="function">s16vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874183792" class="indexterm"/> <code class="function">u16vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874180608" class="indexterm"/> <code class="function">s32vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874177424" class="indexterm"/> <code class="function">u32vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874174240" class="indexterm"/> <code class="function">s64vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874171056" class="indexterm"/> <code class="function">u64vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874167872" class="indexterm"/> <code class="function">f32vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874164688" class="indexterm"/> <code class="function">f64vector-ref</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Return the element at index <em class="replaceable"><code>i</code></em> of the uniform vector <em class="replaceable"><code>v</code></em>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874160144" class="indexterm"/> <code class="function">s8vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874156576" class="indexterm"/> <code class="function">u8vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874153008" class="indexterm"/> <code class="function">s16vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874149440" class="indexterm"/> <code class="function">u16vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874145872" class="indexterm"/> <code class="function">s32vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874142304" class="indexterm"/> <code class="function">u32vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874138736" class="indexterm"/> <code class="function">s64vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874135168" class="indexterm"/> <code class="function">u64vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874131600" class="indexterm"/> <code class="function">f32vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874128032" class="indexterm"/> <code class="function">f64vector-set!</code> <em class="replaceable"><code>v</code></em> <em class="replaceable"><code>i</code></em> <em class="replaceable"><code>x</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Set the element at index <em class="replaceable"><code>i</code></em> of uniform vector <em class="replaceable"><code>v</code></em>
to the value <em class="replaceable"><code>x</code></em>, which must be a number coercible
to the appropriate type.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874122608" class="indexterm"/> <code class="function">s8vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874119808" class="indexterm"/> <code class="function">u8vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874117008" class="indexterm"/> <code class="function">s16vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874114208" class="indexterm"/> <code class="function">u16vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874111408" class="indexterm"/> <code class="function">s32vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874108608" class="indexterm"/> <code class="function">u32vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874105808" class="indexterm"/> <code class="function">s64vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874103008" class="indexterm"/> <code class="function">u64vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874100208" class="indexterm"/> <code class="function">f32vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874097408" class="indexterm"/> <code class="function">f64vector-&gt;list</code> <em class="replaceable"><code>v</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Convert the uniform vetor <em class="replaceable"><code>v</code></em> to a list containing the elments of <em class="replaceable"><code>v</code></em>.
</p>
        </blockquote>
      </div>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874093232" class="indexterm"/> <code class="function">list-&gt;s8vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874090368" class="indexterm"/> <code class="function">list-&gt;u8vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874087504" class="indexterm"/> <code class="function">list-&gt;s16vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874084640" class="indexterm"/> <code class="function">list-&gt;u16vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874081776" class="indexterm"/> <code class="function">list-&gt;s32vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874078912" class="indexterm"/> <code class="function">list-&gt;u32vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874076048" class="indexterm"/> <code class="function">list-&gt;s64vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874073184" class="indexterm"/> <code class="function">list-&gt;u64vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874070320" class="indexterm"/> <code class="function">list-&gt;f32vector</code> <em class="replaceable"><code>l</code></em></p>
      <p class="synopsis" kind="Procedure"><span class="kind">Procedure</span><span class="ignore">: </span><a id="idm139667874067456" class="indexterm"/> <code class="function">list-&gt;f64vector</code> <em class="replaceable"><code>l</code></em></p>
      <div class="blockquote">
        <blockquote class="blockquote">
          <p>Create a uniform vector of the appropriate type, initializing it
with the elements of the list <em class="replaceable"><code>l</code></em>.  The elements of <em class="replaceable"><code>l</code></em>
must be numbers coercible the new vector’s element type.
</p>
        </blockquote>
      </div>
      <section class="sect2" title="Relationship with Java arrays" epub:type="division" id="idm139667874063184">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title">Relationship with Java arrays</h3>
            </div>
          </div>
        </div>
        <p>Each uniform array type is implemented as an <em class="firstterm">underlying Java array</em>,
and a length field.
The underlying type is
<code class="literal">byte[]</code> for <code class="literal">u8vector</code> or <code class="literal">s8vector</code>;
<code class="literal">short[]</code> for <code class="literal">u16vector</code> or <code class="literal">u16vector</code>;
<code class="literal">int[]</code> for <code class="literal">u32vector</code> or <code class="literal">s32vector</code>;
<code class="literal">long[]</code> for <code class="literal">u64vector</code> or <code class="literal">s64vector</code>;
<code class="literal">float[]</code> for <code class="literal">f32vector</code>; and
<code class="literal">double[]</code> for <code class="literal">f32vector</code>.
The length field allows a uniform array to only use the
initial part of the underlying array.  (This can be used
to support Common Lisp’s fill pointer feature.)
This also allows resizing a uniform vector.  There is no
Scheme function for this, but you can use the <code class="literal">setSize</code> method:
</p>
        <pre class="screen">(invoke some-vector 'setSize 200)
</pre>
        <p>If you have a Java array, you can create a uniform vector
sharing with the Java array:
</p>
        <pre class="screen">(define arr :: byte[] ((primitive-array-new byte) 10))
(define vec :: u8vector (make u8vector arr))
</pre>
        <p>At this point <code class="literal">vec</code> uses <code class="literal">arr</code> for its underlying storage,
so changes to one affect the other.
It <code class="literal">vec</code> is re-sized so it needs a larger underlying array,
then it will no longer use <code class="literal">arr</code>.
</p>
      </section>
    </section>
    <footer>
      <div class="navfooter">
        <ul>
          <li>
            <b class="toc">
              <a href="Uniform-vectors.xhtml#idm139667874063184">Relationship with Java arrays</a>
            </b>
          </li>
        </ul>
        <p>
          Up: <a accesskey="u" href="Data-structures.xhtml">Data structures</a></p>
        <p>
        Previous: <a accesskey="p" href="Vectors.xhtml">Vectors</a></p>
        <p>
        Next: <a accesskey="n" href="Bytevectors.xhtml">Bytevectors</a></p>
      </div>
    </footer>
  </body>
</html>
